/**
 * Created by renzhiqiang on 17/7/27.
 */
import React ,{Component, PropTypes, PureComponent} from "react";
module.exports  = React.createClass({

    getInitialState: function() {
        return { likedaaaa: true};
    },
    componentWillMount:function () {
        console.info('111');
        console.info(this.props);
        this.context.router.listenBefore(function (data) {
            console.info(data);

        })
        this.context.router.listen(function (data) {
            console.info(data);

        })
    },
    contextTypes:{
        color: PropTypes.string.isRequired,
        router: PropTypes.object.isRequired
    },
    childContextTypes: {
        col: React.PropTypes.string
    },
    getChildContext: function() {
        return {col: "purple"};
    },
    aa:function () {
        debugger;
        this.context.router.push({
            pathname: '/aaaaaa'
        })
    },
    render: function() {
        return <div onClick={this.aa}>ES5</div>;
    }
});
